*******************************************************************************
*Replication script for study 1: Claassen, J., Lenzner, T., Höhne, J.K., & 
*Ziller, C. (in press). A survey mode of the future? Investigating respondents' 
*willingness to participate in self-administered video-based web surveys. 
*Methods, Data, Analyses. 
*******************************************************************************

*import dataset
use "video_based_web_surveys_study_1.dta", replace


*******************
*Sample composition
*******************

*age
sum age

*gender
tab gender

*euducation
tab education

*device
tab device

*experimental groups
tab group

*statistical tests to evaluate the effectiveness of random assignment
oneway age group, tabulate bonferroni
tab group gender, row chi
tab group education, row chi
tab group device, row chi


****************************************************************************
*Table 1. Respondents' willingness to participate in web surveys with video-
*based questions and answers (Study 1)
****************************************************************************

*distribution of willingness by experimental group (video-based questions)
tab willingness_questions group, col

*exclude non-substantive answers options for chi-squared test (video-based questions)
gen willingness_questions_4_point = willingness_questions if willingness_questions >= 1 & willingness_questions <= 4

*chi-squared test (video-based questions)
tab willingness_questions_4_point group, col chi

*distribution of willingness by experimental group (video-based answers)
tab willingness_answers group, col

*exclude non-substantive answers options for chi-squared test (video-based answers)
gen willingness_answers_4_point = willingness_answers if willingness_answers >= 1 & willingness_answers <= 4

*chi-squared test (video-based answers)
tab willingness_answers_4_point group, col chi


****************************************************************************
*Table 3. Reasons for willingness to participate in web surveys with video-
*based questions and answers (Study 1)
****************************************************************************

*video-based questions (only respondents who are probably or definitely willing)
tab1 questions_final_reason_1 questions_final_reason_2 questions_final_reason_3 questions_final_reason_4 questions_final_reason_5 questions_final_reason_6 questions_final_reason_7 questions_final_reason_8 questions_final_reason_9 questions_final_reason_98 questions_final_reason_99 if willingness_questions == 3 | willingness_questions == 4

*video-based answers (only respondents who are probably or definitely willing)
tab1 answers_final_reason_1 answers_final_reason_2 answers_final_reason_3 answers_final_reason_4 answers_final_reason_5 answers_final_reason_6 answers_final_reason_7 answers_final_reason_8 answers_final_reason_9 answers_final_reason_98 answers_final_reason_99 if willingness_answers == 3 | willingness_answers == 4


******************************************************************************
*Table 4. Reasons for nonwillingness to participate in web surveys with video-
*based questions and answers (Study 1)
******************************************************************************

*video-based questions (only respondents who are probably or definitely not willing)
tab1 questions_final_reason_10 questions_final_reason_11 questions_final_reason_12 questions_final_reason_13 questions_final_reason_14 questions_final_reason_15 questions_final_reason_16 questions_final_reason_17 questions_final_reason_18 questions_final_reason_19 questions_final_reason_98 questions_final_reason_99 if willingness_questions == 1 | willingness_questions == 2

*video-based answers (only respondents who are probably or definitely not willing)
tab1 answers_final_reason_10 answers_final_reason_11 answers_final_reason_12 answers_final_reason_13 answers_final_reason_14 answers_final_reason_15 answers_final_reason_16 answers_final_reason_17 answers_final_reason_18 answers_final_reason_19 answers_final_reason_98 answers_final_reason_99 if willingness_answers == 1 | willingness_answers == 2


*****************************************************************************
*Table 5. OLS regressions with willingness to participate in web surveys with 
*video-based questions and answers as dependent variables (Study 1)
*****************************************************************************

*M2 (video-based questions)
reg willingness_questions_4_point i.group technology openness conscientiousness extraversion agreeableness  neuroticism  interest difficulty topic_sensitivity age i.female i.education i.smartphone /*without robust standard errors*/
generate sample1 = e(sample)

reg willingness_questions_4_point i.group technology openness conscientiousness extraversion agreeableness  neuroticism  interest difficulty topic_sensitivity age i.female i.education i.smartphone, vce(robust) /*with robust standard errors*/

*M1 (video-based questions)
reg willingness_questions_4_point i.group if sample1 == 1 /*without robust standard errors*/

reg willingness_questions_4_point i.group if sample1 == 1, vce(robust) /*with robust standard errors*/


*M2 (video-based answers)
reg willingness_answers_4_point i.group technology openness conscientiousness extraversion agreeableness  neuroticism  interest difficulty topic_sensitivity age i.female i.education i.smartphone /*without robust standard errors*/
generate sample2 = e(sample)

reg willingness_answers_4_point i.group technology openness conscientiousness extraversion agreeableness  neuroticism  interest difficulty topic_sensitivity age i.female i.education i.smartphone, vce(robust) /*with robust standard errors*/

*M1 (video-based answers)
reg willingness_answers_4_point i.group if sample2 == 1 /*without robust standard errors*/

reg willingness_answers_4_point i.group if sample2 == 1, vce(robust) /*with robust standard errors*/


***********************************************
*Intercoder reliability (video-based questions)
***********************************************

*transform dataset into long format (two observations per respondent: Coder A & Coder B)
reshape long questions_coder_@_reason_1 questions_coder_@_reason_2 questions_coder_@_reason_3 questions_coder_@_reason_4 questions_coder_@_reason_5 questions_coder_@_reason_6 questions_coder_@_reason_7 questions_coder_@_reason_8 questions_coder_@_reason_9 questions_coder_@_reason_10 questions_coder_@_reason_11 questions_coder_@_reason_12 questions_coder_@_reason_13 questions_coder_@_reason_14 questions_coder_@_reason_15 questions_coder_@_reason_16 questions_coder_@_reason_17 questions_coder_@_reason_18 questions_coder_@_reason_19 questions_coder_@_reason_98 questions_coder_@_reason_99, i(id) j(coder) string

*create variable with unique value for every code combination
egen unique_reason = group(questions_coder__reason_1 questions_coder__reason_2 questions_coder__reason_3 questions_coder__reason_4 questions_coder__reason_5 questions_coder__reason_6 questions_coder__reason_7 questions_coder__reason_8 questions_coder__reason_9 questions_coder__reason_10 questions_coder__reason_11 questions_coder__reason_12 questions_coder__reason_13 questions_coder__reason_14 questions_coder__reason_15 questions_coder__reason_16 questions_coder__reason_17 questions_coder__reason_18 questions_coder__reason_19 questions_coder__reason_98 questions_coder__reason_99) if intercoder_reliability_questions == 1

*transform dataset back into wide format
reshape wide unique_reason questions_coder__reason_1 questions_coder__reason_2 questions_coder__reason_3 questions_coder__reason_4 questions_coder__reason_5 questions_coder__reason_6 questions_coder__reason_7 questions_coder__reason_8 questions_coder__reason_9 questions_coder__reason_10 questions_coder__reason_11 questions_coder__reason_12 questions_coder__reason_13 questions_coder__reason_14 questions_coder__reason_15 questions_coder__reason_16 questions_coder__reason_17 questions_coder__reason_18 questions_coder__reason_19 questions_coder__reason_98 questions_coder__reason_99, i(id) j(coder) string

*calculate agreement rate
gen agreement = (unique_reasonA == unique_reasonB) if intercoder_reliability_questions == 1
tab agreement

*calculate cohen's kappa
kap unique_reasonA unique_reasonB if intercoder_reliability_questions == 1



*********************************************
*Intercoder reliability (video-based answers)
*********************************************

use "video_based_web_surveys_study_1.dta", replace

*transform dataset into long format (two observations per respondent: Coder A & Coder B)
reshape long answers_coder_@_reason_1 answers_coder_@_reason_2 answers_coder_@_reason_3 answers_coder_@_reason_4 answers_coder_@_reason_5 answers_coder_@_reason_6 answers_coder_@_reason_7 answers_coder_@_reason_8 answers_coder_@_reason_9 answers_coder_@_reason_10 answers_coder_@_reason_11 answers_coder_@_reason_12 answers_coder_@_reason_13 answers_coder_@_reason_14 answers_coder_@_reason_15 answers_coder_@_reason_16 answers_coder_@_reason_17 answers_coder_@_reason_18 answers_coder_@_reason_19 answers_coder_@_reason_98 answers_coder_@_reason_99, i(id) j(coder) string

*create variable with unique value for every code combination
egen unique_reason = group(answers_coder__reason_1 answers_coder__reason_2 answers_coder__reason_3 answers_coder__reason_4 answers_coder__reason_5 answers_coder__reason_6 answers_coder__reason_7 answers_coder__reason_8 answers_coder__reason_9 answers_coder__reason_10 answers_coder__reason_11 answers_coder__reason_12 answers_coder__reason_13 answers_coder__reason_14 answers_coder__reason_15 answers_coder__reason_16 answers_coder__reason_17 answers_coder__reason_18 answers_coder__reason_19 answers_coder__reason_98 answers_coder__reason_99) if intercoder_reliability_answers == 1

*transform dataset back into wide format
reshape wide unique_reason answers_coder__reason_1 answers_coder__reason_2 answers_coder__reason_3 answers_coder__reason_4 answers_coder__reason_5 answers_coder__reason_6 answers_coder__reason_7 answers_coder__reason_8 answers_coder__reason_9 answers_coder__reason_10 answers_coder__reason_11 answers_coder__reason_12 answers_coder__reason_13 answers_coder__reason_14 answers_coder__reason_15 answers_coder__reason_16 answers_coder__reason_17 answers_coder__reason_18 answers_coder__reason_19 answers_coder__reason_98 answers_coder__reason_99, i(id) j(coder) string

*calculate agreement rate
gen agreement = (unique_reasonA == unique_reasonB) if intercoder_reliability_answers == 1
tab agreement

*calculate cohen's kappa
kap unique_reasonA unique_reasonB if intercoder_reliability_answers == 1

